package com.example.membersteward.entity;

import com.example.membersteward.enums.Sex;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ExcelTableInfo {
    /**
     * 生成的表头名称
     */
    private String tableName;

    /**
     * 下拉框
     */

    private List<String> dropdownOptions;

    /**
     * 描述
     */

    private String description;

    /**
     * 字段列宽
     */
    private int columnWidth;

    /**
     * 获取用户表excel模板
     * @return
     */
    public static List<ExcelTableInfo> getUserTableExcelTemp() {
        return new ArrayList<ExcelTableInfo>(){{
            add(new ExcelTableInfo("用户昵称",null,"用户昵称长度不超过10位",20));
            add(new ExcelTableInfo("用户账号",null,"账号长度为 5 - 20 位，仅包含字母和数字",20));
            add(new ExcelTableInfo("手机号",null,null,20));
            add(new ExcelTableInfo("性别", Sex.getOptions(),null,10));
            add(new ExcelTableInfo("用户邮箱",null,null,20));
            add(new ExcelTableInfo("用户生日",null,"用户生日请输入格式为 yyyy-MM-dd 的日期",20));
            add(new ExcelTableInfo("用户地址",null,"用户地址长度不超过255位",20));
        }};
    }

    /**
     * 获取用户表导出基础表头
     * @return
     */
    public static List<ExcelTableInfo> exportUserTable() {
        return new ArrayList<ExcelTableInfo>(){{
            add(new ExcelTableInfo("用户昵称",null,null,20));
            add(new ExcelTableInfo("用户账号",null,null,20));
            add(new ExcelTableInfo("手机号",null,null,20));
            add(new ExcelTableInfo("性别", null,null,10));
            add(new ExcelTableInfo("用户状态", null,null,13));
            add(new ExcelTableInfo("用户邮箱",null,null,20));
            add(new ExcelTableInfo("用户生日",null,null,20));
            add(new ExcelTableInfo("用户地址",null,null,20));
            add(new ExcelTableInfo("个人简介",null,null,20));
            add(new ExcelTableInfo("最后操作时间",null,null,20));
        }};

    }
}
